<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var arr = [3, 1, 4, 2, 5, 21, 6, 15, 63]
        function sortA(arr){
            for(var i=0; i<arr.length-1; i++){
                for(var j=i+1; j<arr.length; j++){
                    var cur = arr[i]
                    if(cur>arr[j]){
                        var index = arr[j]
                        arr[j] = cur
                        arr[i] = index
                    }
                }
            }
            return arr
        }
        console.log(sortA(arr));
    </script>
</body>
</html>